const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')

module.exports = {
  entry: {
    main: './src/index.js'
  },
  devServer: {
    contentBase: './dist',
    port: 8080
  },
  devtool: 'cheap-source-map',
  plugins: [/*new CleanWebpackPlugin({
    cleanOnceBeforeBuildPatterns: [path.resolve(__dirname, 'dist')]
  }),*/ new HtmlWebpackPlugin({
    template: './src/index.html'
  })],
  output: {
    path: path.resolve(__dirname, 'dist'),
    filename: '[name].js'
  },
  mode: 'development'
}